if(NOT KMPKG_TARGET_IS_WINDOWS)
    kmpkg_check_linkage(ONLY_STATIC_LIBRARY)
endif()

kmpkg_from_gitee(
        OUT_SOURCE_PATH SOURCE_PATH
        REPO kumo-pub/pollux
        REF v${VERSION}
        SHA512 1ea869159282b61b3bd7f9149a4faf640604708807762ef75b2919aa5cb588c8cdf0c0ac2e9bea5bb4d11cc9ed8282ea62d0ae568ef1d92618fae3cdc2aab6d0
        HEAD_REF master
)

message(STATUS "compile pollux need to care the build parallel threads, every thread neel about 3GB memory, using KMPKG_MAX_CONCURRENCY env to control the concurrent")
kmpkg_cmake_configure(
    SOURCE_PATH "${SOURCE_PATH}"
    DISABLE_PARALLEL_CONFIGURE
    OPTIONS
        -DKMCMAKE_BUILD_TEST=OFF
)

SET(KMPKG_POLICY_EMPTY_PACKAGE enabled)

kmpkg_cmake_install()
kmpkg_cmake_config_fixup(PACKAGE_NAME pollux CONFIG_PATH lib/cmake/pollux)
kmpkg_fixup_pkgconfig()

kmpkg_copy_pdbs()

file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include")
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/share")

kmpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/LICENSE")
